import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个整数: ");
        int num = scanner.nextInt();

        for (int i = 1; i <= num; i++) {
            if (Number(i)) {
                System.out.println(i + " 是完数");
            }
        }

        scanner.close();
    }

    public static boolean Number(int num) {
        int sum = 0;
        for (int i = 1; i < num; i++) {
            if (num % i == 0) {
                sum += i;
            }
        }
        return sum == num;
    }
}